<template>
  <div class="child5">
    <p>子组件5</p>
    <p>玩具:{{ computer }}</p>
    <p>书籍:{{ book }}本</p>
    <button @click="miunHouse($parent)">干掉父亲一套房子</button>
    <br />
  </div>
</template>

<script setup lang="ts" name="Childs5">
import { ref } from "vue";

const computer = ref("苹果");
const book = ref(50);

const miunHouse = (p: any) => {
  p.house -= 1;
};

defineExpose({ book });
</script>

<style scoped lang="scss">
.child5 {
  background-color: orangered;
  padding: 10px;
}
</style>
